package com.hsav.kcxb.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.SearchView;
import android.widget.BaseAdapter;
import android.widget.ListView;

import com.hsav.kcxb.R;
import com.hsav.kcxb.adapter.AttentionAdapter;
import com.hsav.kcxb.bean.AttentionBean;

import java.util.ArrayList;

public class AttentionActivity extends BaseActivity {

    private ListView mListView;
    private SearchView mSearchView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_attention);
        initView();
    }

    private void initView() {
        mListView = (ListView)findViewById(R.id.lv_atten);
        mSearchView = (SearchView)findViewById(R.id.search_view);
        mSearchView.setIconifiedByDefault(false);
        mSearchView.setSubmitButtonEnabled(true);
        mSearchView.setQueryHint("找好友（名字，ID等）");
        mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
            @Override
            public boolean onQueryTextSubmit(String query) {
                return false;
            }

            @Override
            public boolean onQueryTextChange(String newText) {
                return false;
            }
        });

        ArrayList<AttentionBean> attenList = new ArrayList<>();
        attenList.add(new AttentionBean("","zhao","ahha","src",true));
        attenList.add(new AttentionBean("tain","lal","ll","dsfd",false));
        AttentionAdapter attentionAdapter = new AttentionAdapter(this,attenList,false);
        mListView.setAdapter(attentionAdapter);
    }
}
